var e = require("../../../@babel/runtime/helpers/interopRequireDefault")(require("../DPagination")), a = getApp(), o = new e.default("records"), t = a.getNetAddresss("plugin.commission-ranking.api.get-commission-ranking.my-bonus-log");

Page({
    data: {
        records: {},
        income: 0,
        userInfo: null,
        recordTotal: 0
    },
    onLoad: function(e) {
        o.bind(this), o.clean(), this.loadRewardRecords();
    },
    onPullDownRefresh: function() {
        o.clean(), this.loadRewardRecords();
    },
    onReachBottom: function() {
        this.loadRewardRecords();
    },
    onShareAppMessage: function() {},
    onShareTimeline: function() {},
    loadRewardRecords: function() {
        var e = this;
        o.loading || o.finished || (wx.showLoading({
            title: "加载中",
            mask: !0
        }), o.loading = !0, a._getNetWork({
            url: t,
            data: {
                page: o.loadPage
            },
            success: function(a) {
                var t = a.data, n = t.data, i = t.result, r = t.msg;
                if (o.loading = !1, wx.stopPullDownRefresh(), wx.hideLoading(), 0 != i) {
                    var s = {
                        recordTotal: 0
                    };
                    (n.data.data.length < n.per_page || n.current_page == n.last_page) && (o.finished = !0), 
                    n.total !== e.data.income && (s.income = n.total), o.limit != n.per_page && (o.limit = n.per_page), 
                    n.data.data.length > 0 && o.push(n.data.data), s.recordTotal = n.total, null == e.data.userInfo && (s.userInfo = n.member), 
                    e.setData(s);
                } else wx.showToast({
                    title: r,
                    icon: "none"
                });
            }
        }));
    }
});